package object.library.user;

import object.library.BookList;
import object.library.operation.IOperation;

public abstract class User {
    protected String name;
    protected IOperation[] operations;
    public User(String name){
        this.name = name;
    }

    //显示用户菜单，返回值表示用户输入的序号
    public abstract int menu();

    public void work(int choice, BookList bookList){
        if(choice < 0 || choice >= operations.length){
            System.out.println("输入的选项非法！");
            return;
        }
        operations[choice].work(bookList);
    }
}
